term_{$field}
Filter HookDescription
Filters the term field sanitized for display. The dynamic portion of the hook name, `$field`, refers to the term field name.Hook Information
File Location |
wp-includes/taxonomy.php
View on GitHub
|
Hook Type | Filter |
Line Number | 1894 |
Hook Parameters
Type | Name | Description |
---|---|---|
mixed
|
$value
|
Value of the term field. |
int
|
$term_id
|
Term ID. |
string
|
$taxonomy
|
Taxonomy slug. |
string
|
$context
|
Context to retrieve the term field value. |
Usage Examples
Basic Usage
<?php
// Hook into term_{$field}
add_filter('term_{$field}', 'my_custom_filter', 10, 4);
function my_custom_filter($value, $term_id, $taxonomy, $context) {
// Your custom filtering logic here
return $value;
}
Source Code Context
wp-includes/taxonomy.php:1894
- How this hook is used in WordPress core
<?php
1889 * @param mixed $value Value of the term field.
1890 * @param int $term_id Term ID.
1891 * @param string $taxonomy Taxonomy slug.
1892 * @param string $context Context to retrieve the term field value.
1893 */
1894 $value = apply_filters( "term_{$field}", $value, $term_id, $taxonomy, $context );
1895
1896 /**
1897 * Filters the taxonomy field sanitized for display.
1898 *
1899 * The dynamic portions of the filter name, `$taxonomy`, and `$field`, refer
PHP Documentation
<?php
/**
* Filters the term field sanitized for display.
*
* The dynamic portion of the hook name, `$field`, refers to the term field name.
*
* @since 2.3.0
*
* @param mixed $value Value of the term field.
* @param int $term_id Term ID.
* @param string $taxonomy Taxonomy slug.
* @param string $context Context to retrieve the term field value.
*/
Quick Info
- Hook Type: Filter
- Parameters: 4
- File: wp-includes/taxonomy.php
Related Hooks
Related hooks will be displayed here in future updates.